<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>编辑生命意愿</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    }

    body {
      background: linear-gradient(135deg, #F5F7FA 0%, #E8F4FD 100%);
      color: #333333;
      min-height: 100vh;
      line-height: 1.6;
    }

    /* 顶部导航栏 */
    .header {
      background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
      color: white;
      padding: 20px;
      position: relative;
      min-height: 80px;
      display: flex;
      align-items: center;
      box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
    }

    .back-btn {
      position: absolute;
      left: 20px;
      top: 50%;
      transform: translateY(-50%);
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: white;
      font-size: 18px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      transition: all 0.3s ease;
      backdrop-filter: blur(10px);
    }

    .back-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: translateY(-50%) scale(1.1);
    }

    .header-title {
      font-size: 20px;
      font-weight: 600;
      text-align: center;
      flex: 1;
      letter-spacing: 0.5px;
    }

    /* 内容区域 */
    .content-container {
      background-color: white;
      margin: 20px 0;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
      overflow: hidden;
    }

    /* 表单区域 */
    .form-container {
      padding: 25px;
    }

    /* 主标题 */
    .main-title {
      font-size: 20px;
      font-weight: 600;
      color: #333;
      margin-bottom: 25px;
      letter-spacing: 0.5px;
      position: relative;
      padding-left: 15px;
    }

    .main-title::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 4px;
      height: 20px;
      background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
      border-radius: 2px;
    }

    /* 表单分组 */
    .form-section {
      margin-bottom: 30px;
      padding-bottom: 25px;
      border-bottom: 1px solid #F0F0F0;
    }

    .form-section:last-child {
      border-bottom: none;
      margin-bottom: 0;
    }

    .section-title {
      font-size: 18px;
      font-weight: 600;
      color: #333;
      margin-bottom: 12px;
      letter-spacing: 0.5px;
    }

    .section-description {
      font-size: 14px;
      color: #666;
      margin-bottom: 20px;
      line-height: 1.5;
    }

    /* 单选按钮组 */
    .radio-group {
      display: flex;
      flex-direction: column;
      gap: 15px;
    }

    .radio-option {
      display: flex;
      align-items: flex-start;
      padding: 20px;
      border: 2px solid #E0E0E0;
      border-radius: 12px;
      background-color: #FAFAFA;
      cursor: pointer;
      transition: all 0.3s ease;
      position: relative;
    }

    .radio-option:hover {
      border-color: #B0B0B0;
      background-color: #F5F5F5;
    }

    .radio-option.selected {
      border-color: #2196F3;
      background-color: rgba(33, 150, 243, 0.05);
    }

    .radio-input {
      margin-right: 15px;
      margin-top: 2px;
      width: 20px;
      height: 20px;
      border: 2px solid #E0E0E0;
      border-radius: 50%;
      background-color: white;
      position: relative;
      flex-shrink: 0;
    }

    .radio-input::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background-color: #2196F3;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .radio-option.selected .radio-input::after {
      opacity: 1;
    }

    .radio-text {
      flex: 1;
      font-size: 16px;
      color: #333;
      line-height: 1.5;
    }

    /* 多选按钮组 */
    .checkbox-group {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 15px;
    }

    .checkbox-option {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px 15px;
      border: 2px solid #E0E0E0;
      border-radius: 12px;
      background-color: #FAFAFA;
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 16px;
      font-weight: 500;
      color: #333;
      text-align: center;
    }

    .checkbox-option:hover {
      border-color: #B0B0B0;
      background-color: #F5F5F5;
    }

    .checkbox-option.selected {
      border-color: #2196F3;
      background-color: rgba(33, 150, 243, 0.1);
      color: #2196F3;
    }

    /* 输入组 */
    .input-group {
      display: flex;
      flex-direction: column;
      gap: 15px;
      margin-bottom: 20px;
    }

    .form-input {
      width: 100%;
      padding: 15px 18px;
      border: 1px solid #E0E0E0;
      border-radius: 8px;
      font-size: 16px;
      color: #333;
      transition: all 0.3s ease;
      background-color: white;
    }

    .form-input:focus {
      outline: none;
      border-color: #2196F3;
      box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
      background-color: white;
    }

    .form-input:hover {
      border-color: #B0B0B0;
    }

    .form-input::placeholder {
      color: #999;
    }

    /* 按钮组 */
    .button-group {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 20px;
    }

    .delete-btn {
      display: flex;
      align-items: center;
      color: #666;
      background: none;
      border: none;
      cursor: pointer;
      font-size: 14px;
      transition: color 0.3s ease;
    }

    .delete-btn:hover {
      color: #F44336;
    }

    .delete-icon {
      margin-right: 8px;
      font-size: 16px;
    }

    .add-btn {
      background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
      color: white;
      border: none;
      border-radius: 25px;
      padding: 12px 20px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      display: flex;
      align-items: center;
      transition: all 0.3s ease;
      box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    }

    .add-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
    }

    .add-icon {
      margin-right: 8px;
      font-size: 16px;
    }

    /* 响应式设计 */
    @media (max-width: 768px) {
      .header {
        padding: 15px;
        min-height: 70px;
      }

      .header-title {
        font-size: 18px;
      }

      .content-container {
        margin: 15px 0;
      }

      .form-container {
        padding: 20px;
      }

      .main-title {
        font-size: 18px;
        margin-bottom: 20px;
      }

      .form-section {
        margin-bottom: 25px;
        padding-bottom: 20px;
      }

      .section-title {
        font-size: 16px;
      }

      .section-description {
        font-size: 13px;
      }

      .radio-option {
        padding: 15px;
      }

      .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
      }

      .checkbox-option {
        padding: 15px;
        font-size: 15px;
      }
    }
  </style>
</head>

<body>
  <!-- 顶部导航栏 -->
  <div class="header">
    <button class="back-btn" id="backBtn">
      ←
    </button>
    <div class="header-title">编辑生命意愿</div>
  </div>

  <!-- 内容区域 -->
  <div class="content-container">
    <div class="form-container">
      <!-- 主标题 -->
      <div class="main-title">生命·意愿表明信息</div>

      <!-- 意愿表明 -->
      <div class="form-section">
        <div class="section-title">意愿表明</div>
        <div class="section-description">当无法用自己的意愿传达治疗方针时，请从以下选项中选择一个方针</div>

        <div class="radio-group">
          <div class="radio-option" data-value="full-treatment">
            <div class="radio-input"></div>
            <div class="radio-text">希望进行最大限度的延命治疗直到最后</div>
          </div>

          <div class="radio-option selected" data-value="no-treatment">
            <div class="radio-input"></div>
            <div class="radio-text">当判断为没有恢复希望时，不希望进行任何延长生命的治疗</div>
          </div>

          <div class="radio-option" data-value="palliative">
            <div class="radio-input"></div>
            <div class="radio-text">希望重视减轻痛苦的缓和治疗</div>
          </div>
        </div>
      </div>

      <!-- 器官捐赠 -->
      <div class="form-section">
        <div class="section-title">器官捐赠</div>
        <div class="section-description">请选择您同意捐赠的所有器官</div>

        <div class="checkbox-group">
          <div class="checkbox-option" data-organ="heart">心脏</div>
          <div class="checkbox-option" data-organ="lung">肺</div>
          <div class="checkbox-option" data-organ="liver">肝脏</div>
          <div class="checkbox-option" data-organ="kidney">肾脏</div>
          <div class="checkbox-option" data-organ="pancreas">胰腺</div>
          <div class="checkbox-option" data-organ="intestine">小肠</div>
          <div class="checkbox-option" data-organ="eye">眼球</div>
        </div>
      </div>

      <!-- 拥有决定权的人 -->
      <div class="form-section">
        <div class="section-title">拥有决定权的人</div>

        <div class="input-group">
          <input type="text" class="form-input" placeholder="请输入姓名" id="decisionName">
          <input type="tel" class="form-input" placeholder="请输入电话号码" id="decisionPhone">
        </div>

        <div class="button-group">
          <button class="delete-btn" id="deleteDecision">
            <span class="delete-icon">🗑️</span> 删除
          </button>
          <button class="add-btn" id="addDecision">
            <span class="add-icon">+</span> 添加
          </button>
        </div>
      </div>

      <!-- 葬礼意愿 -->
      <div class="form-section">
        <div class="section-title">葬礼意愿</div>

        <!-- 希望通知葬礼的人 -->
        <div style="margin-bottom: 25px;">
          <div class="section-title" style="font-size: 16px; margin-bottom: 15px;">希望通知葬礼的人</div>

          <div class="input-group">
            <input type="text" class="form-input" placeholder="请输入姓名" id="funeralNotifyName">
            <input type="tel" class="form-input" placeholder="请输入电话号码" id="funeralNotifyPhone">
          </div>

          <div class="button-group">
            <button class="delete-btn" id="deleteFuneralNotify">
              <span class="delete-icon">🗑️</span> 删除
            </button>
            <button class="add-btn" id="addFuneralNotify">
              <span class="add-icon">+</span> 添加
            </button>
          </div>
        </div>

        <!-- 不希望通知葬礼的人 -->
        <div>
          <div class="section-title" style="font-size: 16px; margin-bottom: 15px;">不希望通知葬礼的人</div>

          <div class="button-group">
            <div></div>
            <button class="add-btn" id="addFuneralNoNotify">
              <span class="add-icon">+</span> 添加
            </button>
          </div>
        </div>
      </div>

      <!-- 墓地·神社 -->
      <div class="form-section">
        <div class="section-title">墓地·神社</div>

        <div class="button-group">
          <div></div>
          <button class="add-btn" id="addGrave">
            <span class="add-icon">+</span> 添加
          </button>
        </div>
      </div>
    </div>
  </div>

  <script>
    // 返回按钮点击事件
    document.getElementById('backBtn').addEventListener('click', function () {
      window.location.href = '主页.html';
    });

    // 单选按钮功能
    document.querySelectorAll('.radio-option').forEach(option => {
      option.addEventListener('click', function () {
        document.querySelectorAll('.radio-option').forEach(opt => opt.classList.remove('selected'));
        this.classList.add('selected');
      });
    });

    // 多选按钮功能
    document.querySelectorAll('.checkbox-option').forEach(option => {
      option.addEventListener('click', function () {
        this.classList.toggle('selected');
      });
    });

    // 删除按钮功能
    document.getElementById('deleteDecision').addEventListener('click', function () {
      document.getElementById('decisionName').value = '';
      document.getElementById('decisionPhone').value = '';
      alert('已删除决定权人信息');
    });

    document.getElementById('deleteFuneralNotify').addEventListener('click', function () {
      document.getElementById('funeralNotifyName').value = '';
      document.getElementById('funeralNotifyPhone').value = '';
      alert('已删除葬礼通知人信息');
    });

    // 添加按钮功能
    document.getElementById('addDecision').addEventListener('click', function () {
      const name = document.getElementById('decisionName').value;
      const phone = document.getElementById('decisionPhone').value;
      if (name && phone) {
        alert('已添加决定权人：' + name + ' (' + phone + ')');
      } else {
        alert('请填写完整信息');
      }
    });

    document.getElementById('addFuneralNotify').addEventListener('click', function () {
      const name = document.getElementById('funeralNotifyName').value;
      const phone = document.getElementById('funeralNotifyPhone').value;
      if (name && phone) {
        alert('已添加葬礼通知人：' + name + ' (' + phone + ')');
      } else {
        alert('请填写完整信息');
      }
    });

    document.getElementById('addFuneralNoNotify').addEventListener('click', function () {
      alert('添加不希望通知葬礼的人功能');
    });

    document.getElementById('addGrave').addEventListener('click', function () {
      alert('添加墓地·神社信息功能');
    });
  </script>
</body>

</html>